package cn.webdai.rabbitmq.example_01;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 消息接收者(直接模式)
 * @author 戴金华
 * @date 2019-12-04 15:25
 */
@Component
@RabbitListener(queues = "hello")
public class MessageReceiver {


    @RabbitHandler
    public void receive(String message){
        System.out.println("接受到的消息是:"+message);
    }
}
